<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="theme-color" content="#33474d">
	<title>DNS安装配置 | 失落的乐章</title>
	<link rel="stylesheet" href="/css/style.css" />
	
      <link rel="alternate" href="/atom.xml" title="失落的乐章" type="application/atom+xml">
    
</head>

<body>

	<header class="header">
		<nav class="header__nav">
			
				<a href="/archives" class="header__link">Archive</a>
			
				<a href="/tags" class="header__link">Tags</a>
			
				<a href="/atom.xml" class="header__link">RSS</a>
			
		</nav>
		<h1 class="header__title"><a href="/">失落的乐章</a></h1>
		<h2 class="header__subtitle">技术面前，永远都是学生。</h2>
	</header>

	<main>
		<article>
	
		<h1>DNS安装配置</h1>
	
	<div class="article__infos">
		<span class="article__date">2017-10-12</span><br />
		
		
			<span class="article__tags">
			  	<a class="article__tag-link" href="/tags/DNS/">DNS</a>
			</span>
		
	</div>

	

	
		<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;使用 bind 来搭建 DNS 服务，首先安装 bind</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 ~]<span class="comment"># yum install -y bind</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;备份配置文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 ~]<span class="comment"># cp /etc/named.conf /etc/named.conf.bak</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;把默认配置文件清空，然后自定义配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@192 ~]<span class="comment"># &gt;/etc/named.conf</span></div><div class="line">[root@192 ~]<span class="comment"># vim /etc/named.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;加入如下配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line">options &#123;</div><div class="line">    directory <span class="string">"/var/named"</span>;</div><div class="line">&#125;;</div><div class="line">zone <span class="string">"."</span> IN &#123;</div><div class="line">    <span class="built_in">type</span> hint;</div><div class="line">    file <span class="string">"named.ca"</span>;</div><div class="line">&#125;;</div><div class="line">zone <span class="string">"localhost"</span> IN &#123;</div><div class="line">    <span class="built_in">type</span> master;</div><div class="line">    file <span class="string">"localhost.zone"</span>;</div><div class="line">&#125;;</div><div class="line">zone <span class="string">"0.0.127.in-addr.arpa"</span> IN &#123;</div><div class="line">    <span class="built_in">type</span> master;</div><div class="line">    file <span class="string">"named.local"</span>;</div><div class="line">&#125;;</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;保存配置后，修改其属主</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@192 ~]<span class="comment"># chown named /etc/named.conf</span></div><div class="line">[root@192 ~]<span class="comment"># cd /var/named</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;定义根域配置文件，没有 dig 命令先安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># yum install bind-utils</span></div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># dig -t NS .&gt;named.ca</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后定义本地域配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim localhost.zone</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;加入如下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">@            IN     SOA     localhost.   admin.localhost. (</div><div class="line">                                                             2017041101</div><div class="line">                                                             1H</div><div class="line">                                                             10M</div><div class="line">                                                             7D</div><div class="line">                                                             1D</div><div class="line">                                                                 )</div><div class="line">@             IN          NS           localhost.</div><div class="line">localhost.    IN          A            127.0.0.1</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;再定以泛解析配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim named.local</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;加入如下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$TTL</span> 86400</div><div class="line">@                IN    SOA    localhost.   admin.localhost.  (</div><div class="line">                                                              2017041101</div><div class="line">                                                              1H</div><div class="line">                                                              10M</div><div class="line">                                                              7D</div><div class="line">                                                              1D</div><div class="line">                                                              )</div><div class="line">@                IN    NS             localhost.</div><div class="line">1                IN    PTR            localhost</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测配置是否有问题</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkconf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测正解析</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkzone "localhost" /var/named/localhost.zone</span></div><div class="line">/var/named/localhost.zone:2: no TTL specified; using SOA MINTTL instead</div><div class="line">zone localhost/IN: loaded serial 2017041101</div><div class="line">OK</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测反解析</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkzone "0.0.127.in-addr.arpa" /var/named/named.local</span></div><div class="line">zone 0.0.127.in-addr.arpa/IN: loaded serial 2017041101</div><div class="line">OK</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;生成 rndc.key ，如果没有这个 key ， named 是启动不了的。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># rndc-confgen -r /dev/urandom -a</span></div><div class="line">wrote key file <span class="string">"/etc/rndc.key"</span></div><div class="line">[root@192 named]<span class="comment"># chown named:named /etc/rndc.key</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;启动 named 服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># /etc/init.d/named start</span></div><div class="line">启动 named： [确定]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;查看是否有 53 端口</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># netstat -lnp | grep named</span></div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/01.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;首先测试正向解析</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/02.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;接着测试反解析</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/03.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;现在只是建立了一个本地的域 localhost ，下面增加一个域名（zone）</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim /etc/named.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;增加如下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">zone <span class="string">"123.com"</span> IN &#123;</div><div class="line">    <span class="built_in">type</span> master;</div><div class="line">    file <span class="string">"123.com.zone"</span>;</div><div class="line">&#125;;</div><div class="line">zone <span class="string">"137.168.192.in-addr.arpa"</span> IN &#123;</div><div class="line">    <span class="built_in">type</span> master;</div><div class="line">    file <span class="string">"192.168.zone"</span>;</div><div class="line">&#125;;</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测是否有问题</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkconf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;编辑 zone 文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim /var/named/123.com.zone</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测是否出错</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkzone "123.com" /var/named/123.com.zone</span></div><div class="line">zone 123.com/IN: loaded serial 2017041101</div><div class="line">OK</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;编辑反解析文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim /var/named/192.168.zone</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;写入如下内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$TTL</span> 600</div><div class="line">@          IN     SOA     ns.123.com.     root.123.com. (</div><div class="line">                                                           2017041101</div><div class="line">                                                           1H</div><div class="line">                                                           10M</div><div class="line">                                                           7D</div><div class="line">                                                           1D</div><div class="line">                                                           )</div><div class="line">@          IN     NS       ns.123.com.</div><div class="line">10         IN     PTR      ns.123.com.</div><div class="line">11         IN     PTR      mail.123.com.</div><div class="line">73         IN     PTR      www.123.com.</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;检测是否出错</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># named-checkzone "137.168.192.in-addr.arpa" 192.168.zone</span></div><div class="line">zone 137.168.192.in-addr.arpa/IN: loaded serial 2017041101</div><div class="line">OK</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;重启 named 服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># /etc/init.d/named restart</span></div><div class="line">停止 named：. [确定]</div><div class="line">启动 named： [确定]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;测试</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># dig @127.0.0.1 www.123.com</span></div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/04.png?raw=true" alt=""></figure></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># dig @127.0.0.1 -x 192.168.137.11</span></div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/05.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;123.com 的域配置好后，要想使用它必须把系统里面的 DNS 服务器 IP 设定为这台机器的 IP ，但是这样也会带来一个问题，它只能解析 123.com 的域名，其他域名不能解析，这时候需要给它配置 DNS 转发。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim /etc/named.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在 options{} 里面增加</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">forward first;</div><div class="line">forwarders &#123;8.8.8.8;&#125;;</div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/06.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这两行就是用来配置转发的，该 DNS 服务器不能解析的域名会转发到 8.8.8.8 这个 DNS 服务器上去解析。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;任何服务器都有可能因为某些原因导致不能正常提供服务，所以有必要为 DNS 服务器配置一个备用的，但是这两台服务器需要保证数据的一直性，比如更改主上配置把 www.123.com 解析 IP 更改了，那么备用服务器上也得跟着自动变。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下面就是配置主从，首先在从服务器上安装 bind </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@KVM ~]<span class="comment"># yum install -y bind</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后拷贝主上的配置文件到从上，这里主服务器 192.168.0.73 ，从服务器 192.168.0.74</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;以下操作在主服务器上</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># yum -y install openssh-clients</span></div><div class="line">[root@192 named]<span class="comment"># scp /etc/named.conf 192.168.0.74:/etc/</span></div><div class="line">[root@192 named]<span class="comment"># scp /var/named/localhost.zone 192.168.0.74:/var/named/</span></div><div class="line">[root@192 named]<span class="comment"># scp /var/named/named.local 192.168.0.74:/var/named/</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;从服务器上，拷贝过来后，修改一下 /etc/named.conf </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@KVM ~]<span class="comment"># vim /etc/named.conf</span></div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/07.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改为</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/08.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;从上生成 rndc.key</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@KVM ~]<span class="comment"># rndc-confgen -r /dev/urandom -a</span></div><div class="line">wrote key file <span class="string">"/etc/rndc.key"</span></div><div class="line">[root@KVM ~]<span class="comment"># chown named:named /etc/rndc.key</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;从上启动 named </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@KVM ~]<span class="comment"># /etc/init.d/named start</span></div><div class="line">启动 named： [确定]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;启动成功后会在 /var/named 下生成一个 slaves 目录，这个目录下会有 192.168.zone 和 123.com.zone 这两个文件，内容是和主上的一样的。</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/09.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后在从上测试是否可以解析</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@KVM ~]<span class="comment"># dig @127.0.0.1 www.123.com</span></div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/10.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下面测试主从同步</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在主 dns 上更改文件 </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># vim /var/named/123.com.zone</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在最后一行增加</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">123     IN     A     1.1.1.1</div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/11.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;另外需要修改一下 第三行的那个数字串，这个是用来做标记的，只有这个数字变化了，才可以一让从自动跟着变，数字只能是变大，不能减小， 把 2017041101 改成 2017041102</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;重启主 named 服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@192 named]<span class="comment"># /etc/init.d/named restart</span></div><div class="line">停止 named：. [确定]</div><div class="line">启动 named： [确定]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;经测试发现一个问题：就是从经常会同步特别慢，这是很要命的。所有需要做一个特殊操作，在主上的 /etc/named.conf 中，123.com 的zone 中增加两行：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">notify yes;</div><div class="line">also-notify &#123;192.168.0.74;&#125;;</div></pre></td></tr></table></figure>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/dns%20%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/12.png?raw=true" alt=""></figure></p>

	

	
		<span class="different-posts"><a href="/2017/10/12/Dns、Iredmaill/3. DNS安装配置/" onclick="window.history.go(-1); return false;">⬅️ Go back </a></span>

	

</article>

	</main>

	<footer class="footer">
	<div class="footer-content">
		
	      <div class="footer__element">
	<p>Hi there, <br />welcome to my Blog glad you found it. Have a look around, will you?</p>
</div>

	    
	      <div class="footer__element">
	<h5>Check out</h5>
	<ul class="footer-links">
		<li class="footer-links__link"><a href="/archives">Archive</a></li>
		
		  <li class="footer-links__link"><a href="/atom.xml">RSS</a></li>
	    
		<li class="footer-links__link"><a href="/about">about page</a></li>
		<li class="footer-links__link"><a href="/tags">Tags</a></li>
		<li class="footer-links__link"><a href="/categories">Categories</a></li>
	</ul>
</div>

	    

		<div class="footer-credit">
			<span>© 2017 失落的乐章 | Powered by <a href="https://hexo.io/">Hexo</a> | Theme <a href="https://github.com/HoverBaum/meilidu-hexo">MeiliDu</a></span>
		</div>

	</div>


</footer>



</body>

</html>
